Fix preview wheel zoom scale updates - #5330
Conversation
|
Thanks @Diyoncrz18 — the narrowed bug write-up and the red→green test seam are both clear here. I've queued maintainer review, and because this changes preview behavior it’ll also need a manual QA pass before merge, so please hold off self-merging for now; we’ll loop that in once the PR is merge-ready. |
mrcfps
left a comment
There was a problem hiding this comment.
@Diyoncrz18 I reviewed the wheel-zoom path across the HTML preview viewer, the injected srcdoc/URL preview bridges, and the added regression coverage. The change reuses the existing zoom presets, keeps iframe-origin messages constrained to the active preview frame, and preserves Draw overlay wheel behavior by avoiding zoom updates while the draw overlay is open. I also checked the scoped daemon bridge injection update and the focused test additions; I could not run the Vitest commands locally because this prepared checkout has no installed node_modules, but the patch itself looks sound. Thanks for tightening this user-facing preview interaction and for including focused coverage.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.|
Thanks @Diyoncrz18 for taking a fresh pass on this and for adding focused coverage around the preview zoom path. We rechecked the current production build and can no longer reproduce the original issue from #3626 there. Linking this PR with the issue for tracking, and we'll use that updated repro status when deciding whether a code change is still needed here. Related issue: #3626 |
|
Closing this PR because the original linked issue (#3626) can no longer be reproduced on the current production build, so we are not taking this implementation as-is. Thanks again for the focused tests and investigation here. |
















































Fixes #3626
Why
I am opening this PR to close the design preview zoom bug reported in #3626. While using an HTML design preview, scrolling the mouse wheel over the preview at 100% did not change the toolbar value or the preview transform, so the preview stayed at
scale(1).The pain being addressed is user-facing: wheel zoom appeared to be available on the preview surface, but it did not update the same zoom state used by the toolbar dropdown and the preview frame scale.
What users will see
Scrolling the mouse wheel over an HTML design preview now changes the preview zoom:
Draw/Mark mode keeps its existing wheel behavior for scrolling the preview iframe instead of changing preview zoom.
Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-pack/tools-prflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolTRANSLATIONS.mdfor the locale workflow)package.json(dependenciesordevDependencies); workspace-packagepackage.jsonfiles are out of scope. Include a paragraph on what we get vs. what bytes we ship (seeCONTRIBUTING.md-> Code style)Screenshots
Not attached. This is an interaction-only bug fix with no layout or visual style change; the entry point is the existing design preview zoom control. Regression tests cover the toolbar label and preview transform updates after wheel zoom.
Bug fix verification
apps/web/tests/components/FileViewer.test.tsxmainand green on this branch? yes. The new focused test fails before the source change because wheel-up leaves the zoom button at100%; it passes after the fix.apps/web/tests/runtime/srcdoc.test.tsapps/daemon/tests/project-file-range.test.tsValidation
corepack pnpm exec vitest run -c vitest.config.ts tests/components/FileViewer.test.tsx -t "preview zoom|Draw overlay wheel"fromapps/webcorepack pnpm exec vitest run -c vitest.config.ts tests/runtime/srcdoc.test.tsfromapps/webcorepack pnpm exec vitest run -c vitest.config.ts tests/project-file-range.test.ts -t "injects the URL preview scroll bridge only when requested"fromapps/daemoncorepack pnpm --filter @open-design/web typecheckcorepack pnpm --filter @open-design/contracts buildcorepack pnpm --filter @open-design/registry-protocol buildcorepack pnpm --filter @open-design/daemon exec tsc -p tsconfig.json --noEmitcorepack pnpm --filter @open-design/daemon exec tsc -p tsconfig.tests.json --noEmitcorepack pnpm guardgit diff --check HEAD